<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?>
</head>
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=penjualan_arisanmingguan.xls");
header("Pragma: no-cache");
header("Expires: 0");
?>
<body>
<table width="1500" align="center">
<tr>
   	  <td width="1309" align="center">
        <table width="1500" align="center">
        <tr>
          <td width="440" rowspan="4" valign="top"><img src="<?php echo base_url();?>images/logo.jpg" />&nbsp;</td>
          <td width="203">&nbsp;</td>
     	  <td width="41"><a href="javascript:window.print()" onclick="location.href='laporan';"><img src="<?php echo base_url();?>/images/print.jpg"/></a></td>
        </tr>
        
        
        <tr>
            <td >&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr align="center">
            
        </tr>
        <tr align="center">
         
        </tr>
        <tr align="center" class="judul">
          <td colspan="2">LAPORAN PENJUALAN <?php echo $default[0]->strnama_cabang;?></td>
          <td>&nbsp;</td>
        </tr>
        <tr align="center" class="judul"> 
          <td colspan="2"><?php echo $default[0]->strnama_jpenjualan?></td>
          <td>&nbsp;</td>
        </tr>
        <tr align="center" class="detail">
          <td colspan="2">WEEK <?php echo $default[0]->intid_week?> ( <?php echo $default[0]->datestart;?>  - <?php echo $default[0]->dateend;?>)</td>
          <td>&nbsp;</td>
        </tr>
    </table>    </td>
  <tr>
    	<td align="center">
       	  <table width="100%" border="0" cellpadding="1" cellspacing="1" id="data" align="center">
        <thead>
        <tr  align="center" class="table" >
           <th >No</th>
           <th >Nama Dealer</th>
           <th>Upline</th>
            <th >Unit</th>
            <th>Cicilan ke-</th>
            <th>Omset</th>
            <th >Group</th>
            <th>Tanggal ikut</th>
        </tr>
    </thead>
    <tbody>

    <!-- ============isi ============ -->

		<?php
        if(!empty($arisan)){
            //print_r($arisan);
			$i=1;
			foreach($arisan as $m) :
            $y = date('Y');
            $sql = mysql_query("Select member.strnama_dealer from member Where strkode_dealer='".$m->strkode_upline."'")or die(mysql_error());
            $c = mysql_fetch_array($sql);
		?>
      	<tr class='data' align='center'>
			<td ><?php echo $i++; ?></td>
            <td align='left'>&nbsp;<?php echo $m->strnama_dealer; ?></td>
            <td align='left'>&nbsp;<?php echo $c['strnama_dealer']; ?></td>
            <td align='left'>&nbsp;<?php echo $m->strnama_unit; ?></td>
            <td align='left'>&nbsp;<?php echo $m->cicilan_ke; ?></td>
            <td align='left'>&nbsp;<?php echo $m->inttotal_omset; ?></td>
            <td align='left'>&nbsp;<?php echo $m->group; ?></td>
            <td align='left'>&nbsp;<?php echo $m->datetgl; ?></td>
          
        </tr>
		<?php
        endforeach;
        ?>
        
        <?php
        }else{
        ?>
    <tr>
        <td colspan="6" align="center">
            No Data Display
        </td>
    </tr>
    <?php } ?>

    </tbody>
</table>      </td>
    </tr>
</table>
</body>
</html>